local base = game_mode.base
local vpad = require("scr/joystick")
local lmode = class("local_mode",base)

function lmode:init()
    base.init(self)
    if OS == "Android" then
        self.vpad = vpad()
    end
end

function lmode:setPlayer(tank,id)
    tank:setID(id)
    self.player = tank
    sound:play("battle")
    self.cam:setTarget(self.player)
    tank:mark()
end

function lmode:update(dt)
    base.update(self,dt)
    if self.vpad then self.vpad:update() end
end


function lmode:draw()
    love.graphics.setColor(1, 1, 1, 1)
    self.cam:draw(function()
        if self.map then self.map:draw() end
        for id,obj in pairs(self.objects) do
            obj:draw()
        end
        if self.map then self.map:drawForest() end
        if self.player then
            self.player:drawMark()
        end
    end)
    if self.vpad then self.vpad:draw() end
end


return lmode

